package com.chenjie.executor.day11;


/**
 * packageName com.chenjie.executor.day09
 *
 * @author chenjie
 * @version JDK 8
 * @className Main1 (此处以class为例)
 * @date 2024/5/27
 * @description TODO
 */
public class Main1 {

    /**
     *
     * @param args
     */
    public static void main(String[] args) {
       PrintTask pringTask = new PrintTask();
        Thread thread=new Thread(pringTask);
        System.out.println("thread daemon="+thread.isDaemon());

        //设置该线程为后台线程
        thread.setDaemon(true);
        thread.start();
        System.out.println("thread daemon="+thread.isDaemon());

        try {
            Thread.sleep(1000L);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        System.out.println("结束方法");
    }
}
